package com.zyzd.pathdemo.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.AppCompatSeekBar;
import android.widget.SeekBar;

import com.zyzd.pathdemo.R;
import com.zyzd.pathdemo.view.MaskFilterView;

public class MaskFilterActivity extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener {

    public MaskFilterView maskView;
    public AppCompatSeekBar seekBar1;
    public AppCompatSeekBar seekBar2;
    public AppCompatSeekBar seekBar3;
    public AppCompatSeekBar seekBar4;
    public AppCompatSeekBar seekBar5;
    public AppCompatSeekBar seekBar6;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mask_filter);
        maskView = (MaskFilterView) findViewById(R.id.maskView);
        seekBar1 = (AppCompatSeekBar) findViewById(R.id.seekBar1);
        seekBar2 = (AppCompatSeekBar) findViewById(R.id.seekBar2);
        seekBar3 = (AppCompatSeekBar) findViewById(R.id.seekBar3);
        seekBar4 = (AppCompatSeekBar) findViewById(R.id.seekBar4);
        seekBar5 = (AppCompatSeekBar) findViewById(R.id.seekBar5);
        seekBar6 = (AppCompatSeekBar) findViewById(R.id.seekBar6);

        seekBar1.setOnSeekBarChangeListener(this);
        seekBar2.setOnSeekBarChangeListener(this);
        seekBar3.setOnSeekBarChangeListener(this);
        seekBar4.setOnSeekBarChangeListener(this);
        seekBar5.setOnSeekBarChangeListener(this);
        seekBar6.setOnSeekBarChangeListener(this);
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        maskView.setparam(seekBar1.getProgress() * 1.0f / 50, seekBar2.getProgress() * 1.0f / 50, seekBar3.getProgress() * 1.0f / 50,
                seekBar4.getProgress() * 1.0f / 100, seekBar5.getProgress(), seekBar6.getProgress() );
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {

    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {

    }
}
